import { createRouter, createWebHistory } from "vue-router";

export const RouterHomeChildren = [
  {
    path: "/Detection",
    name: "智能检测",
    meta:{
      code: 0
    },
    beforChange_img: "/src/assets/image/icon_1.png",
    changeEd_img: "/src/assets/image/icon_1_on.png",
    component: () => import("../views/Home/Detection.vue"),
  },
  {
    path: "/posture",
    name: "就业态势",
    meta:{
      code: 1
    },
    beforChange_img: "/src/assets/image/icon_2.png",
    changeEd_img: "/src/assets/image/icon_2_on.png",
    component: () => import("../views/Home/posture.vue"),
  },
  {
    path: "/manage",
    name: "安防管理",
    meta:{
      code: 2
    },
    beforChange_img: "/src/assets/image/icon_3.png",
    changeEd_img: "/src/assets/image/icon_3_on.png",
    component: () => import("../views/Home/manage.vue"),
  },
  {
    path: "/equipment",
    name: "设备运维",
    meta:{
      code: 3
    },
    beforChange_img: "/src/assets/image/icon_4.png",
    changeEd_img: "/src/assets/image/icon_4_on.png",
    component: () => import("../views/Home/equipment.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      redirect: "Detection",
      component: () => import("../views/HomeView.vue"),
      children: RouterHomeChildren,
    },
    {
      path: "/login",
      name: "login",
      component: () => import("../views/LoginView.vue"),
    },
  ],
});

export default router;
